Getting Started
This guide will take you step by step through the process of creating a Luna contract, via the management console.
All of these steps can also be executed via the API, and you can get started by looking at the Auth page
To understand more about the SDK, please check the Core Concepts section and SDK section
Step One - Sign Up
First let's sign up to Luna and create your first organization.
- Navigate to the Luna app in your browser of choice.
- Enter your details to create an account. The
Invitation Code
will have been provided to you separately. - Verify your account by clicking on the link sent to your Luna login email.
- Create your first organization.
Step Two - Project Creation
Next comes project creation. Projects are isolated places where you can develop templates in the Luna contract language.
As a reminder, projects are powered by git so we'll need to clone our project locally to allow us to make updates.
- Navigate to the Project tab.
- Click
New Project
, then provide aname
anddescription
. - Once created click the
Clone Repo
button and copy the URL. Note:repo
is short forrepository
, these terms are interchangeable. - (Optional) If you haven't installed git on your local machine do so now by following this guide.
- In a local terminal navigate to a place you wish to save your project. Once there, run
git clone <URL from step 3>
with the URL replaced with the one you copied on step 3. - Git should prompt for your username. Use the email address you used to sign up to the platform in Step 1.2.
- Git will then prompt for your password. Do not use the password you signed up with. Instead we need to create an access token by navigating to the
Settings
tab. - Once on the
Settings
tab, click Access Tokens, then Create Token. Use theToken
value as the password to authenticate the git clone command. - If successful the code should be downloaded to your local machine.
Step Three - Making Changes
At this point we can make changes to the Template to develop our financial product. See the Writing a Template for more details.
- Open the downloaded code in your editor of choice. The repo will include a simple Hello World Template. For now, let's simply rename this Template.
- Open the
my_project/template.py
file and change the name of the Template class fromMyTemplate
toMyAwesomeTemplate
. - To publish (or push) the changes we need to use
git
. Rungit commit -am 'Rename Template'
which saves your changes to git locally on your machine. Then, to save it remotely, rungit push origin master
. This "pushes" the changes to the remote git repository. - Returning to the Project Overview tab in the UI, you should see the update in the
Latest Updates
widget. - Once the update is analyzed you should see a summary of the changes in the UI, including the new Template name.
Step Four - Publishing the Template
Once we've pushed our updates we need to release them so we can create contracts.
- From the Project Summary view, click on the
Updates
tab in the top bar. - You should see the details of the update we made in Step Three. Click on the
Release
button to release the update. - If you click on the
Releases
tab you should be able to see the released Template.
Step Five - Creating Contracts
Finally we can create a contract from our Template.
- Click on the
Contracts
tab, thenCreate Contract
- Enter the name of the Template you created above and click
Search
. - Click
Create Contract
thenRun
. - Review the information of your new running contract.